import request from '@/utils/request'

// 查询小区列表
export function listHousing(query) {
  return request({
    url: '/community/housing/list',
    method: 'get',
    params: query
  })
}
export function listHousings(query) {
  return request({
    url: '/community/housing/lists',
    method: 'get',
    params: query
  })
}
// 查询行政区域列表
export function listRegions(query) {
  return request({
    url: '/community/region/list',
    method: 'get',
    params: query
  })
}
// 查询小区详细
export function getHousing(id) {
  return request({
    url: '/community/housing/' + id,
    method: 'get'
  })
}

// 新增小区
export function addHousing(data) {
  return request({
    url: '/community/housing',
    method: 'post',
    data: data
  })
}

// 修改小区
export function updateHousing(data) {
  return request({
    url: '/community/housing',
    method: 'put',
    data: data
  })
}

// 删除小区
export function delHousing(id) {
  return request({
    url: '/community/housing/' + id,
    method: 'delete'
  })
}
